import numpy as np
import cv2

img = cv2.imread("C:\\Users\\86191\\Pictures\\Saved Pictures\\Camera Roll\\hands.png")

# sobel x方向边缘
dst1 = cv2.Sobel(img,cv2.CV_64F,0,1,ksize=5)
# sobel y方向边缘
dst2 = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=5)
#dst = dst1+dst2
dst = cv2.add(dst1,dst2)

# Laplacian边缘检测
ldst = cv2.Laplacian(img,cv2.CV_64F,ksize=5)

# Canny边缘检测
cdst = cv2.Canny(img,50,80)



cv2.imshow("sobel",dst)
cv2.imshow("Laplacian",ldst)
cv2.imshow("Canny",cdst)
cv2.waitKey(0)